import request from '@/config/axios'

// 遴选申请明细 VO
export interface PickDetailVO {
  id: string // 主键
  nickName: string // 姓名
  deptName: string // 研究部
  applyMajor: string // 申请专业
  jobTitle: string // 职称
  highestDegree: string // 最高学位
  applicationFormUrl: string // 申请表url
  appendixUrl: string // 附件url
  result: number // 评审结果
  reviewCount: number // 评委人数
  agreeCount: number // 同意人数
  disagreeCount: number // 不同意人数
  notVoteCount: number // 未投票人数
}

// 遴选申请明细-投票明细 VO
export interface PickVoteDetailVO {
  id: string // 主键
  nickName: string // 姓名
  phone: string,
  deptName: string // 研究部
  jobTitle: string,
  workingStatus: number,
  voteResult: number,
}

// 遴选申请明细 API
export const PickDetailApi = {
  // 查询遴选申请明细分页
  getPickDetailPage: async (params: any) => {
    return await request.get({ url: `/recruit/pick-detail/list`, params })
  },

  // 查询投票明细列表
  getVoteDetailList: async (params: any) => {
    return await request.get({ url: `/recruit/pick-votes/detail`, params })
  },

  // 导出遴选申请明细 Excel
  exportPickDetail: async (batchId: string, isPass?: boolean) => {
    return await request.download({
      url: `/recruit/pick-batch/pick-export`,
      params: { batchId, isPass }
    })
  }
}
